Skip to content

[graphics] Introduce compact form for SVG output#20111

Merged
linev merged 4 commits intoroot-project:masterfrom
linev:compact_svg
Oct 16, 2025
Merged

[graphics] Introduce compact form for SVG output#20111
linev merged 4 commits intoroot-project:masterfrom
linev:compact_svg

Conversation

@linev
Copy link
Member

@linev linev commented Oct 15, 2025

~~Introduce static methods in TSVG class ~~
Add extra argument to TSVG constructor to switch on/off compact mode for svg output files

In compact form and section are excluded.

Also all float values rounded and stored as integer.
For small values lower than 10 use %3.1f format.
Such rounding potentially can have side effects, but let create much smaller files.

Intention to use this functionality in special tests like in roottest/graphics to create SVG files which are small and reproducible on all platforms.

My idea use stressGraphics for such testing.

It is first PR in series.

In compact form <desc> and <defs> section are excluded.
Also all float values rounded and stored as integer.
Such rounding potentially can have side effects, but let create much smaller files.
@github-actions
Copy link

github-actions bot commented Oct 15, 2025

Test Results

    22 files      22 suites   3d 22h 22m 21s ⏱️
 3 692 tests  3 688 ✅ 0 💤 4 ❌
79 276 runs  79 272 ✅ 0 💤 4 ❌

For more details on these failures, see this check.

Results for commit df6839c.

♻️ This comment has been updated with latest results.

linev added 3 commits October 15, 2025 13:07
Font outside 1..15 range not exists in SVG and does not supported
While such parameter will be only used for very special applications one can specify it
when create TSVG instance
If value too small, one have to preserve several
significant digits.
So small values converted with %3.1f or %5.3f format,
or just stored as before
@linev linev merged commit addbb37 into root-project:master Oct 16, 2025
24 of 27 checks passed
@linev linev deleted the compact_svg branch October 16, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants